package com.herenit.order_model.aop;

import com.herenit.order_model.exception.MyException;
import com.herenit.order_model.model.ResponseVO;
import com.herenit.order_model.utils.ResponseVOUtils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(MyException.class)
    public ResponseVO handler(MyException ex){
        return ResponseVOUtils.handlerException(ex);
    }
}
